package com.gxgeek.javabasic.Threads;

/**
 * Created by GX on 2017/8/21.
 */
//@Setter
public class MyThreads extends Thread {
    private Bean bean;
    private String name;

    public MyThreads(Bean bean, String name) {
        this.bean = bean;
        this.name = name;
    }

    @Override
    public void run() {
        synchronized (this.name){
//            if (Contans.one==0){
//                Contans.one=1;
//                while (true){
//                }
//            }
            Contans.count++;
            System.out.println(bean.getName()+":"+Contans.count);
        }
    }
}
